import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:responsive_grid_list/responsive_grid_list.dart';

import 'account_textField2.dart';
import 'num_textField2.dart';
//传递数据
typedef void TabsCallBack(Map content);
class NumSectionText extends StatefulWidget {
  final TabsCallBack contentStrCallBack;
  String title = '';
  NumSectionText(
      {
        required this.title,
        required this.contentStrCallBack,
        });

  @override
  _AccountEditTextState createState() => _AccountEditTextState();
}
class _AccountEditTextState extends State<NumSectionText> {

  @override
  Widget build(BuildContext context) {
    return Column(
      crossAxisAlignment: CrossAxisAlignment.start,
      children: [
        SizedBox(height: 19.h,),
        Text(widget.title,style: TextStyle(
          color: Color(0xFF333333),
          fontSize: 14.sp
        ),),
        SizedBox(height: 9.h,),
        Container(
          child: Row(
            children: [
              Container(
                width:78.w,
                height: 30.h,
                alignment: Alignment.center,
                decoration: BoxDecoration(
                  color: Colors.white,
                  borderRadius: BorderRadius.circular(2.r),
                  border: Border.all(width: 1.w,color: Color(0xFFD6D6D6))
                ),
                child: NumText(
                  //获取返回的输入内容
                  hitText: '',
                  contentStrCallBack: (content) {
                    Map aa= {'min':content};
                    widget.contentStrCallBack(aa);
                  }, key: ValueKey('min'),
                ),
              ),
              SizedBox(width: 17.w,),
              Text('一',style: TextStyle(
                color:Color(0xFF666666) ,
                fontSize: 12.sp
              ),),
              SizedBox(width: 17.w,),
              Container(
                width:78.w,
                height: 30.h,
                alignment: Alignment.center,
                  decoration: BoxDecoration(
                      color: Colors.white,
                      borderRadius: BorderRadius.circular(2.r),
                      border: Border.all(width: 1.w,color: Color(0xFFD6D6D6))
                  ),
                child: NumText(
                  //获取返回的输入内容
                  hitText: '',
                  contentStrCallBack: (content) {
                    Map aa= {'max':content};
                    widget.contentStrCallBack(aa);
                  }, key: ValueKey('max'),
                ),
              ),
            ],
          ),
        )
      ],
    );
  }


  Widget _items(text,index){
    return Container(
      alignment: Alignment.center,
      height: 34.h,
      decoration: BoxDecoration(
        color: Color(0xFFF7F8FC),
        borderRadius: BorderRadius.circular(6.r),
        border: Border.all(width: 1.w,color:Color(0xFFEDEEEF) )
      ),
      child: Text(text,style: TextStyle(color: Color(0xFF333333),fontSize: 12.sp),),
    );
  }

}